#ifndef __EZFB_PIXEL_DRAWING_FUNCTIONS__
#define __EZFB_PIXEL_DRAWING_FUNCTIONS__
#include "ezfb_types.h"

#ifdef __cplusplus
extern "C" {
#endif 

#define  MODE_BPP1   0
#define  MODE_BPP4   1
#define  MODE_BPP8   2
#define  MODE_BPP16  3
#define  MODE_BPP18  4
#define  MODE_BPP24  5
#define  MODE_BPP32  6

#define RGB565to888ValueR(rgb555)	((BYTE)((rgb555 >> 8) & 0xF8))
#define RGB565to888ValueG(rgb555)	((BYTE)((rgb555 >> 3) & 0xFC))
#define RGB565to888ValueB(rgb555)	((BYTE)((rgb555 << 3) & 0xF8))
#define RGB888to565(r,g,b)			((WORD)(((((WORD)r)<<8)&0xF800)|((((WORD)g)<<3)&0x7E0)|(((WORD)b)>>3)))

// drawing fuctions
int      ezfb_put_pixel    (struct ezfb* fb, u_int  x, u_int  y, u_int c);
u_int    ezfb_get_pixel    (struct ezfb* fb, u_int  x, u_int y);
int      ezfb_put_line     (struct ezfb* fb, int x1, int y1, int  x2, int  y2, u_int c) ;
int      ezfb_put_rectangle(struct ezfb* fb, int x1, int y1, int  x2, int  y2, u_int c, int filled) ;
int 	 ezfb_put_ellipse  (struct ezfb* fb, int x1, int y1, int x2, int y2, u_int c, int filled) ; 

// bpp pixel format converter, 
// convert the src_mode pixel format into current use pixel format
void     ezfb_conv_pixel(struct ezfb* fb, u_int * cres, u_int csrc, int src_mode) ; 

// put memory buffer into current 16bpp, 18bpp or 24bpp frame buffer 
// the memory buffer must contain the whole screen size memory image.
void     ezfb_put_screen(struct ezfb* fb, u_char * mem_buf, int buf_mode) ; 

// put part of memory buffer into current used frame buffer, need not to whole screen size. 
void 	 ezfb_blt_screen(struct ezfb* fb, u_char * mem_buf, int buf_mode, int x, int y, int w, int h) ; 

void 	 ezfb_alpha_screen(struct ezfb* fb, u_char * mem_buf, u_char * mem_alpha, int buf_mode, int x, int y, int w, int h) ; 

#ifdef __cplusplus
}
#endif 

#endif
